﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using XinYi.CrookedShowMode;
using XinYi.CrookedTopShow.BLL;

namespace XinYi.CrookedShow.Controllers
{
    public class RegisterController : Controller
    {
        RegisterService register = new RegisterService();
        #region 添加用户
        public JsonResult SaveUserInfo(UserInfo userInfo)
        {
            Operate operate = new Operate();
            operate.Success = register.AddUserInfo(userInfo) > 0;
            return Json(operate);
        } 
        #endregion

        #region 查询用户名是否存在
        public JsonResult SelUserName(UserInfo userInfo)
        {
            Operate operate = new Operate();
            operate.Success = register.SelUserName(userInfo) > 0;
            return Json(operate);
        } 
        #endregion

        #region 查询电话号码是否存在
        public JsonResult SelUserPhone(UserInfo userInfo)
        {
            Operate operate = new Operate();
            operate.Success = register.SelUserPhone(userInfo) > 0;
            return Json(operate);
        } 
        #endregion
    }
}